package com.eg366.cglib;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

public class AuthProxy implements MethodInterceptor {

	private String name = "";

	public AuthProxy(String name) {
		this.name = name;
	}

	@Override
	public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
		if (!"eg366".equals(name))
			return null;
		// return method.invoke(obj, args);
		return proxy.invokeSuper(obj, args);
	}

}
